package com.mapbar.pay.service.impl;

import com.mapbar.pay.dao.DeviceDao;
import com.mapbar.pay.entity.ActivationState;
import com.mapbar.pay.entity.Device;
import com.mapbar.pay.service.DeviceService;
import org.apache.log4j.Logger;

/**
 *@Date 创建时间 2010-03-05 10:17:52
 *@author fengbj
 * 
 */
public class DeviceServiceImpl implements DeviceService{

    public Logger log = Logger.getLogger(this.getClass());//日志对象
    private DeviceDao deviceDao;
    
    @Override
    public boolean checkSerial(String serial) {
        if(serial != null){
            return deviceDao.checkSerial(serial);
        }else{
            return false;
        }
    }

    @Override
    public boolean checkDeviceId(String deviceId) {
        if(deviceId != null){
            return deviceDao.checkDeviceId(deviceId);
        }else{
            return false;
        }
    }

    @Override
    public ActivationState createActivation(String serial, String deviceId) {
        if(serial == null || deviceId == null){
            return null;
        }else{
            return deviceDao.createActivation(serial, deviceId);
        }
    }

    @Override
    public Device getDeviceInfo(String serial) {
        if(serial != null){
            return deviceDao.getDeviceInfo(serial);
        }else{
            return null;
        }
    }

    public void setDeviceDao(DeviceDao deviceDao) {
        this.deviceDao = deviceDao;
    }

    @Override
    public String getCrop(String type) {
       return deviceDao.getCrop(type);
    }

    @Override
    public String getBrandsByCorpId(int corpId) {
        return deviceDao.getBrandsByCorpId(corpId);
    }

    @Override
    public String getDeviceModel(int brandId) {
        return deviceDao.getDeviceModel(brandId);
    }

    
	
}
